const mongoose = require('mongoose');
const {dbBase} = require('../config/config.default')
mongoose.connect(dbBase,{useNewUrlParser:true,useUnifiedTopology:true});

const db = mongoose.connection
db.on('error',function(err){
    console.log("数据库连接失败",err)
})

db.once('open',function(){
    console.log("数据库连接成功")
})

module.exports ={
    User:mongoose.model('User',require('./user'),'user')
}